﻿<%@ Page Language="C#" MasterPageFile="~/admin/MainPage/ItemMasterPage.master" AutoEventWireup="true"
    CodeFile="Action.aspx.cs" Inherits="admin_CaseManage_Action" ValidateRequest="false"
    Title="Untitled Page" %>

<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dxuc" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dxrp" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Src="../Controls/uclCheckRefreshed.ascx" TagName="uclCheckRefreshed"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <uc1:uclCheckRefreshed ID="CheckRefreshed1" runat="server"></uc1:uclCheckRefreshed>

    <script src="../../Kinde/kindeditor.js" type="text/javascript"></script>

    <script type="text/javascript">
KE.show({
    id : 'ctl00_ContentPlaceHolder1_ASPxRoundPanel1_txtContent',
     skinType: 'tinymce',
    cssPath : './index.css',
        allowFileManager : true
});
    </script>

    <script type="text/javascript">
    function delImg(obj){ 
    if(confirm("确定删除此图片?")){
    $.ajax({
    url: '../ImageHadder/ImgDelHand.ashx?id='+obj,
    type: 'GET',
    dataType: 'html',
    timeout: 5000,
    error: function(data){
        alert(data);
    },
    success: function(xml){
      $('#'+obj).remove();
    }
});}
}


    </script>

    <br />
    <input type="hidden" id="hdfAction" runat="server" />
    <input type="hidden" id="hdfPid" runat="server" />
    <input type="hidden" id="hdfTid" runat="server" />
    <dxrp:ASPxRoundPanel ID="ASPxRoundPanel1" ShowHeader="False" runat="server" Width="100%">
        <PanelCollection>
            <dxrp:PanelContent runat="server">
                <table class="category" width="100%" align="center">
                    <tr>
                        <td style="width: 100px; text-align: right;">
                           文章标题：
                        </td>
                        <td style="text-align: left;">
                            <table>
                                <tr>
                                    <td>
                                        <dxe:ASPxTextBox ID="txtTitle" Width="300px" runat="server">
                                        </dxe:ASPxTextBox>
                                    </td>
                                    <td>
                                        <div id="ctl00_ContentPlaceHolder1_ASPxRoundPanel1_txtTitle_ITip" style="width: 250px;
                                            display: inline;">
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                  <%--  <tr>
                        <td style="width: 100px; text-align: right">
                            来源：
                        </td>
                        <td style="text-align: left;">
                            <table>
                                <tr>
                                    <td>
                                        <dxe:ASPxTextBox ID="txtSource" Width="150px" runat="server">
                                        </dxe:ASPxTextBox>
                                    </td>
                                    <td>
                                        <div id="Div1" style="width: 250px; display: inline;">
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>--%>
                    <tr>
                        <td style="width: 100px; text-align: right">
                            栏目：
                        </td>
                        <td style="text-align: left;">
                            <table>
                                <tr>
                                    <td>
                                        <asp:DropDownList ID="ddlType" runat="server">
                                        </asp:DropDownList>
                                    </td>
                                    <td>
                                        <div id="ctl00_ContentPlaceHolder1_ASPxRoundPanel1_txtPass_ITip" style="width: 250px;
                                            display: inline;">
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <asp:Repeater ID="rptImages" runat="server">
                        <HeaderTemplate>
                            <tr>
                                <td style="width: 100px; text-align: right; vertical-align: top;">
                                    已添加图片：
                                </td>
                                <td>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <div style="float: left;" id='<%#Eval("id") %>'>
                                <img src='../../uploads/<%#Eval("imgPath") %>' width="100px" height="80px" alt='<%#Eval("imgAlt") %>'
                                    style="border: dashed 1px #ccc; padding-left: 2px;" /><br />
                                <div style="text-align: center;">
                                    <a style="cursor: hand" onclick='javascript:delImg(<%#Eval("id") %>);'>删除</a> |
                                    </div>
                            </div>
                        </ItemTemplate>
                        <FooterTemplate>
                            </td></tr>
                        </FooterTemplate>
                    </asp:Repeater>
                    <tr>
                        <td style="width: 100px; text-align: right" valign="top">
                            添加图片：
                        </td>
                        <td style="text-align: left;">
                            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
                                <tr>
                                    <td>
                                        <dxuc:ASPxUploadControl ID="uploadControl" runat="server"
                                            Height="2px" ShowAddRemoveButtons="false" Width="310px" FileInputCount="1">
                                           
                                        </dxuc:ASPxUploadControl>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; text-align: right" valign="top">
                            内容：
                        </td>
                        <td style="text-align: left; margin: 0px; padding: 0px;">
                            <textarea id="txtContent" runat="server" style="width: 100%; height: 300px; visibility: hidden;"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; text-align: right; height: 37px;">
                            发布时间：
                        </td>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        <dxe:ASPxDateEdit ID="txtDate" runat="server">
                                        </dxe:ASPxDateEdit>
                                    </td>
                                    <td>
                                        <div id="ctl00_ContentPlaceHolder1_ASPxRoundPanel1_txt_pubDate_ITip" style="width: 250px;
                                            display: inline;">
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; text-align: right; height: 48px;">
                            审核状态：
                        </td>
                        <td style="text-align: left; height: 48px;">
                            <asp:DropDownList ID="ddlState" runat="server">
                                <asp:ListItem Value="0" Text="未审核"></asp:ListItem>
                                <asp:ListItem Value="1" Selected="True" Text="已审核"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; text-align: right; height: 37px;">
                            排序编号：
                        </td>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        <dxe:ASPxSpinEdit ID="txtOrderby" runat="server" Height="21px" Number="0" AllowNull="False">
                                        </dxe:ASPxSpinEdit>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 100px; text-align: right">
                        </td>
                        <td style="text-align: left;">
                            <table>
                                <tr>
                                    <td style="width: 80px;">
                                        <dxe:ASPxButton ID="btnSave" runat="server" AutoPostBack="False" Text="确 定" OnClick="ibtnAdd_Click"
                                            Width="66px">
                                            <ClientSideEvents Click="function validate(s, e) {      
                                             e.processOnServer =  jQuery.formValidator.PageIsValid('1'); 
                           }    " />
                                        </dxe:ASPxButton>
                                    </td>
                                    <td style="width: 80px;">
                                        <dxe:ASPxButton ID="btnBack" runat="server" OnClick="btnBack_Click" Text="返 回" Width="63px">
                                        </dxe:ASPxButton>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </dxrp:PanelContent>
        </PanelCollection>
    </dxrp:ASPxRoundPanel>

    <script language="javascript" type="text/javascript">
$(document).ready(function(){
$.formValidator.initConfig({onError:function(msg){alert(msg)}});
      $("#ctl00_ContentPlaceHolder1_ASPxRoundPanel1_txtTitle_I").formValidator({onshow:"请输入",onfocus:"不能为空",oncorrect:"合法"}).InputValidator({min:1,onerror:"不能为空,请确认"});
      
});
    </script>

</asp:Content>
